#include "iobot.h"

unsigned char iobot_get_char(iobot_t *bot)
{
	unsigned char temp = bot->botin[bot->botin_read_pos];
	bot->botin[bot->botin_read_pos] = 0;

	if(bot->botin_read_pos < 1023)
	{
		bot->botin_read_pos++;
	}
	if(bot->botin_read_pos >= bot->botin_write_pos)
	{
		bot->botin_read_pos = 0;
		bot->botin_write_pos = 0;
	}
	return temp;
}
